<template>
  <a-card >
    <template>
      <a-tabs v-model="activeKey" default-active-key="1" @tabClick="tabPane">
        <a-tab-pane tab="项目概况"  key="1">
          <erp-project-report-info-form ref="infoForm" :formData="modal" @goContract="goContract"></erp-project-report-info-form>
        </a-tab-pane>
        <a-tab-pane tab="项目信息" key="2">
          <erp-omc-project-form ref="projectForm" :disabled="true" :projectId="modal.id" :projectShowType="'-1'" :progressShowType="'2'"></erp-omc-project-form>
        </a-tab-pane>
        <a-tab-pane tab="投标信息" key="3">
          <erp-omc-tender-file-form :disabled="true" ref="tenderForm" :projectId="modal.id"></erp-omc-tender-file-form>
        </a-tab-pane>
        <a-tab-pane tab="合同信息" key="4">
          <erp-project-contract-report-form ref="contractForm"  :projectId="modal.id"></erp-project-contract-report-form>
        </a-tab-pane>
        <a-tab-pane tab="进度信息" key="5">
          <erp-omc-project-form ref="progressForm" :disabled="true" :projectId="modal.id" :projectShowType="'1'" :progressShowType="'-2'"></erp-omc-project-form>
        </a-tab-pane>
        <a-tab-pane tab="款项信息" key="6">
          <erp-project-collect-progress-report-form ref="paymentForm" :disabled="true" :projectId="modal.id" ></erp-project-collect-progress-report-form>
        </a-tab-pane>
        <a-tab-pane tab="保证金信息" key="7">
          <ErpProjectFinanceReportForm ref="financeForm"  :projectId="modal.id"></ErpProjectFinanceReportForm>
        </a-tab-pane>
      </a-tabs>
    </template>
  </a-card>
</template>

<script>
  import ErpProjectReportInfoForm from './ErpProjectReportInfoForm'
  import ErpOmcProjectForm from '@/views/erp/omc/project/modules/ErpOmcProjectForm'
  import { getAction } from '@/api/manage'
  export default {
    name: 'ErpProjectReportForm',
    components: {
      ErpOmcTenderFileForm: () => import('@/views/erp/omc/tender/modules/ErpOmcTenderFileForm'),
      ErpProjectContractReportForm: () => import('./ErpProjectContractReportForm'),
      ErpProjectCollectProgressReportForm: () => import('./ErpProjectCollectProgressReportForm'),
      ErpOmcProjectForm: () => import('@/views/erp/omc/project/modules/ErpOmcProjectForm'),
      ErpProjectFinanceReportForm: () => import('./ErpProjectFinanceReportForm'),
      ErpProjectReportInfoForm,
    },
    data () {
      return {
        activeKey: '1',
        processUpdate: true,
        countNum: 0,
        modal: { }
      }
    },
    methods: {
      getDetail (record) {
          this.modal = record;
      },
      getReimbursementDetail (record) {
          this.modal = record;
      },
      //项目概况 点击 收付款金额 回调查看合同
      goContract(val) {
        this.activeKey = '4'
      },
      tabPane(val) {
        this.$nextTick(() => {
          if (val === '4') {
            this.$nextTick(() => {
              this.$refs.contractForm.clearDeail(this.modal.id)
            })
          }
          if (val === '5') {
            this.$nextTick(() => {
              this.$refs.progressForm.edit({ id: this.modal.id })
            })
          }
          if (val === '6') {
            this.$nextTick(() => {
              this.$refs.paymentForm.loadData()
            })
          }
          if (val === '7') {
            this.$nextTick(() => {
              this.$refs.financeForm.loadData()
            })
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
